home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / ansi / m68k / stdarg.h < prev    next >
C/C++ Source or Header  |  1993-04-13  |  824b  |  32 lines

  1. #ifndef _ANSI_M68K_STDARG_H_
  2. #define _ANSI_M68K_STDARG_H_
  3.  
  4. /* BSD compatibility: if #include <varargs.h> seen, don't redefine per ANSI */
  5. #ifndef __VARARGS__
  6.  
  7. /* Indicate that this program uses <stdarg.h> */
  8. #define    __STDARG__
  9.  
  10. #define _DEFINE_VA_LIST
  11. #include <ansi/m68k/stdtypes.h>
  12.  
  13. /* Amount of space required in an argument list for an arg of type TYPE.
  14.    TYPE may alternatively be an expression whose type is used.  */
  15.  
  16. #define __va_rounded_size(TYPE)  \
  17.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  18.  
  19. #define va_start(AP, LASTARG)                         \
  20.  (AP = ((char *) __builtin_next_arg ()))
  21.  
  22. void va_end (va_list);
  23. #define va_end(AP)
  24.  
  25. #define va_arg(AP, TYPE)                        \
  26.  (AP += __va_rounded_size (TYPE),                    \
  27.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  28.  
  29. #endif    __VARARGS__
  30.  
  31. #endif    _ANSI_M68K_STDARG_H_
  32.